//
//  ViewController.m
//  Initialize
//
//  Created by iD Student on 6/26/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    button=[[UIButton alloc]initWithFrame:CGRectMake(0, 0, 100, 100)];
    [button setTitle:@"hi" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(newView) forControlEvents:UIControlStateHighlighted];
    [self.view addSubview:button];
    [button setBackgroundColor:[UIColor blueColor]];
    
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
        return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    } else {
        return YES;
    }
}
-(void)newView{
    UIViewController *view=[self.storyboard instantiateViewControllerWithIdentifier:@"second"];
    [self presentModalViewController:view animated:YES];
}
@end
